package routers

import (
	"caselib/controllers"

	"github.com/astaxie/beego"
)

func init() {
	beego.Router("/", &controllers.MainController{})
	beego.Router("/login", &controllers.LoginController{})
	beego.Router("/signup", &controllers.RegisterController{})

	beego.Router("/:filename([a-z]+\\.vue)", &controllers.StaticController{}, "get:GetVue")
	beego.Router("/:filename([a-z]+\\.html)", &controllers.StaticController{}, "get:GetTpl")
	beego.Router("/:css([a-z0-9]+\\.css)", &controllers.StaticController{}, "get:GetCss")
	beego.Router("/:js([a-zA-Z0-9]+\\.js)", &controllers.StaticController{}, "get:GetJs")
	beego.Router("/:font([a-z\\-]+\\.ttf)", &controllers.StaticController{}, "get:GetFont")
	beego.Router("/:font([a-z\\-]+\\.woff)", &controllers.StaticController{}, "get:GetFont")
	beego.Router("/:pdf([\\s\\S]+\\.pdf)", &controllers.StaticController{}, "get:GetPdf")

	beego.Router("/posts", &controllers.PicsController{})
	beego.Router("/:pic([a-z0-9]+\\.jpe?g)", &controllers.PicsController{})
	beego.Router("/:pic([a-z0-9]+\\.png)", &controllers.PicsController{})
	beego.Router("/:pic([a-z0-9]+\\.gif)", &controllers.PicsController{})
	beego.Router("/imgs", &controllers.PicsController{}, "post:FilterImgs")
	beego.Router("/dropimg", &controllers.PicsController{}, "get:Dropimg")
	beego.Router("/getbv", &controllers.PicsController{}, "get:Getbv")

	beego.Router("/getfunc", &controllers.FuncController{})

	beego.Router("/createtask", &controllers.TaskController{})
	beego.Router("/gettasks", &controllers.TaskController{})
	beego.Router("/gettotal", &controllers.TaskController{}, "*:Total")
	beego.Router("/delete_task", &controllers.TaskController{}, "*:Delete")
	beego.Router("/:user/:name/export", &controllers.TaskController{}, "get:Exportpptx")

	beego.Router("/:user/:name", &controllers.PageController{}) //changePage ?p=1
	beego.Router("/:user/:name/get_pages", &controllers.PageController{}, "get:Get_pages")
	beego.Router("/:user/:name/addtoend", &controllers.PageController{}, "get:Addtoend")
	beego.Router("/:user/:name/addtonext", &controllers.PageController{}, "get:Addtonext")
	beego.Router("/:user/:name/deletepage", &controllers.PageController{}, "post:DeletePage")
	beego.Router("/:user/:task/autosave", &controllers.PageController{}, "post:Autosave")
	beego.Router("/:user/:name/downloadppt", &controllers.PageController{}, "get:Downloadppt")
	beego.Router("/:user/:name/downloadxls", &controllers.PageController{}, "get:Downloadxls")
	beego.Router("/:user/:name/casepages", &controllers.PageController{}, "get:CasePages")
	beego.Router("/:user/:name/addrmcol", &controllers.PageController{}, "post:AddRmCol")
	beego.Router("/:user/:name/rmimg", &controllers.PageController{}, "post:RmImg")

	beego.Router("/assesstitle", &controllers.AssessController{}, "get:AssessTitle")
	beego.Router("/search", &controllers.SearchController{})
	beego.Router("/vers", &controllers.SearchController{}, "get:Vers")
}
